import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Main',
    component: () => import('../views/Main.vue'),

    children:[
      {
        path:'/Home',
        alias: '',
        name:'Home',
        component:()=>import('../views/Home.vue')
      },
      {
        path:'/Menu',
        name:'Menu',
        component:()=>import('../views/Menu.vue')
      },
      {
        path:'/Order',
        name:'Order',
        component:()=>import('../views/Order.vue')
      },
      {
        path:'/ShopBag',
        name:'ShopBag',
        component:()=>import('../views/ShopBag.vue')
      },
      {
        path:'My',
        name:'My',
        component:()=>import('../views/My.vue')
      }
    ]
  },
  {
    path:'/Detail/:pid',
    name:'Detail',
    component:()=>import('../views/Detail.vue')
  },
  {
    path:'/Register',
    name:'Register',
    component:()=>import('../views/Register.vue')
  },
  {
    path:'/Login',
    name:'Login',
    component:()=>import('../views/Login.vue')
  },
  {
    path:'/PlaceOrder',
    name:'PlaceOrder',
    component:()=>import('../views/placeOrder.vue')
  },
  {
    path:'/MyAddress',
    name:'MyAddress',
    component:()=>import('../views/MyAddress.vue')
  },
  {
    path:'/NewAddress',
    name:'NewAddress',
    component:()=>import('../views/NewAddress.vue')
  },
  {
    path:'/PersonalData',
    name:'PersonalData',
    component:()=>import('../views/PersonalData.vue')
  },
  {
    path:'/Collection',
    name:'Collection',
    component:()=>import('../views/Collection.vue')
  },
  {
    path:'/Coupon',
    name:'Coupon',
    component:()=>import('../views/Coupon.vue')
  },
  {
    path:'/Safety',
    name:'Safety',
    component:()=>import('../views/Safety.vue')
  },
  {
    path:'/ChangePassword',
    name:'ChangePassword',
    component:()=>import('../views/ChangePassword.vue')
  },
  {
    path:'/Search',
    name:'Search',
    component:()=>import('../views/Search.vue')
  },
  {
    path:'/ForgetPassword',
    name:'ForgetPassword',
    component:()=>import('../views/ForgetPassword.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
